﻿
namespace Main.Substructure
{
    /// <summary>
    /// This class contains any variables used to keep count of something.
    /// </summary>
    public static class Counter
    {
        // Local variables:
        private static ushort _taskCount = 0;
        private static object _syncObject = new object(); // Object used to prevent cross-threading.

        /// <summary>Returns how many tasks are left to complete.</summary>
        public static ushort TaskCount
        {
            get
            {
                lock (_syncObject)
                    return _taskCount;
            }
            set
            {
                lock (_syncObject)
                    _taskCount = value;
            }
        }
    }
}
